package com.yl.module.base.enums;

public enum EnableEnum {

	DISABLE (0, "隐藏"),

	ENABLE  (1, "正常"),

	UNKNOWN (9, "未知");

	private int value;

	private String text;


	EnableEnum(final int value, final String text) {
		this.value = value;
		this.text = text;
	}

	public int getValue() {
		return this.value;
	}

	public void setValue(final int value) {
		this.value = value;
	}

	public String getText() {
		return this.text;
	}

	public void setText(final String text) {
		this.text = text;
	}

	public static String text(int value) {
		return valueOf(value).getText();
	}

	@Override
	public String toString() {
		return Integer.toString(this.value);
	}

	public static EnableEnum valueOf(int value) {
		for (EnableEnum e : EnableEnum.values()) {
			if (e.value == value) {
				return e;
			}
		}
		return UNKNOWN;
	}
}
